package com.eShopManager.web.action;

import java.util.Map;

import com.eShopManager.intigration.ebay.EbayFacade;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;

public class AcceptAction extends ActionSupport {

	private static final long serialVersionUID = -3465485586409073398L;
	private String username;
	private EbayFacade ebayFacade;

	public void setEbayFacade(EbayFacade ebayFacade) {
		this.ebayFacade = ebayFacade;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	@Override
	public String execute() throws Exception {
		String sessionID = (String) ActionContext.getContext().getSession()
				.get("sessionID");
		String token = ebayFacade.fetchToken(sessionID);
		ActionContext.getContext().getContextMap().put("token", token);
		ebayFacade.getCategorys(token);
		return SUCCESS;
	}

}
